package com.iman.fetion;
import java.net.InetSocketAddress;

import org.apache.mina.common.ConnectFuture;
import org.apache.mina.transport.socket.nio.SocketConnector;

public class FetionProtocolClient {

	private FetionProtocolHandler handler = new FetionProtocolHandler();

	public void connect() {
		try {
			handler.mobile="15900600380";
			handler.password="333333";
			handler.getFetionUri();
			handler.getSipcProxy();
			SocketConnector connector = new SocketConnector();
			ConnectFuture future = connector.connect(new InetSocketAddress(
					handler.getProxyIp(), handler.getProxyPort()), handler);
			future.join();
			handler.getNonce();
//			handler.sendResponse();
//			handler.subPresence();
//			handler.getContactList();
	
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		new FetionProtocolClient().connect();

	}

}
